{% load cache %}

<form action="." method="post" id="student-hoods-form" autocomplete="on">
	{% csrf_token %}
	{% form_errors form %}
	
	<fieldset>
		{% for hidden in form.hidden_fields %}
    		{{ hidden }}
    	{% endfor %}
		
		<label for="id_colour">Select colour</label>

		<div id="id_colour_select" class="colour-selection">
			{% for choice in form.colour.field.choices %}
				<input type="radio" id="id_colour_{{ choice.0.colour }}" name="colour" value="{{ choice.0.colour }}" url="{{ choice.0.get_sizes_url }}"/>
				<label for="id_colour_{{ choice.0.colour }}" style="background-color:#{{ choice.0.rgb }};">{{ choice.0.colour }}</label>
			{% endfor %}
		</div>
        
        <div class="wrap_id_size">
			{{ form.size.label_tag }}
			<select name="size" id="id_size">
			{% for size in form.size.field.choices %}
				<option>Please select a size</option>
				<option value="{{ size.0.colour }} - {{ size.0.size }}">{{ size.0.colour }} - {{ size.0.size }}</option>
			{% endfor %}
			</select>
        </div>
		
		<div class="divider"></div>
		<div class="personal-details">
			<div class="fl">
				{{ form.first_name.label_tag }}
				{{ form.first_name }}
			</div>
			<div class="fr">
				{{ form.surname.label_tag }}
				{{ form.surname }}
			</div>
			<div class="fl">
				{{ form.email.label_tag }}
				{{ form.email }}
			</div>
			<div class="fr">
				{{ form.phone_number.label_tag }}
				{{ form.phone_number }}
			</div>
		</div>
		<div class="divider"></div>
			{% if shop.address_required %}
			
				{{ form.address_line_1.label_tag }}
				{{ form.address_line_1 }}
				
				{{ form.address_line_2.label_tag }}
				{{ form.address_line_2 }}
	
				{{ form.city.label_tag }}
				{{ form.city }}
	
				{{ form.postcode.label_tag }}
				{{ form.postcode }}
			{% endif %}
		<div class="terms-and-cond">
			{{ form.terms }}				
			<label for="id_terms_and_conditions">I agree to the StudentHoods <a href="{% url terms_and_conditions %}" target="_blank" title="(opens a new window)">Terms and Conditions</a></label>
		</div>
		<button class="btn" type="submit">Continue</button>
	</fieldset>
</form>
